<?php if (!defined("_INDEX")) { header("Location: /"); die; }

if ($route->POST('login') != '' && $route->POST('password') != '')
{
	$auth = $user->login($route->POST('login'),$route->POST('password'));

	if (!$auth){
		goToPage("/agent?error=login");
	} else {
		goToPage($_SERVER["HTTP_REFERER"]);
	}
}
?>